var api = require('../../../utils/api.js')
var $ = require('../../../utils/util.js')
var regeneratorRuntime = require('../../../utils/runtime.js')
var app = getApp()

Page({
  data: {
    rush_id: 10,
    reback: '',
    is_reback: false, // 是否有回复
  },
  onLoad: function (options) {
    if ('ticket_num' in options){ 
      this.setData({
        ticket_num: options.ticket_num,
        reback: options.reback,
        is_reback: options.reback != '' && options.reback != 'null' ? true:false
      })
    }
  },

  //##input 输入##
  input_handle(e) {
    this.setData({
      [e.currentTarget.dataset.key]: e.detail.value
    })
  },
  //##input 输入##

  confirmHandle() { // 搜索输入框 
    if ($.isNull(this.data.reback)) {
      $.toast('请输入内容')
    } else {
      var params = {
        ticket_num: this.data.ticket_num,
        reback: this.data.reback
      }
      api.$post(api.robManage.update, params).then((res) => {
        $.toast('提交成功')
        setTimeout(()=>{
          $.linkurl('','back')
        },1500)
      })
    }

  },

  
})